<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<link href="../css/style.css" rel="stylesheet" type="text/css" />

<s:form method="post" theme="simple" name="manageAccounts">
<table width="100%">
	<tr>
		<td>
			<div class="blue-text16" style="margin: 0px 0px 0px 0px">
				<s:text name="manageAccount.header" />
			</div>
			<div class="header-separator-bg" style="margin: 10px 5px 17px 0px"></div>

			<div style="margin: 0px 0px 12px 0px">
				<table width="100%" cellpadding="6" cellspacing="1"
					class="Textfiled-border">
					<tr>
						<td>
							<s:set var="pageSize" value="pageSize" />
							<display:table name="bannerCampaignList" pagesize="${pageSize}"
								cellpadding="0" cellspacing="0"
								requestURI="showManageAccounts.htm" id="row"
								class="common-text">
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.campainname"
									property="campaign" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.startdate"
									class="grid-bg common-text">
									<s:date name="#attr.row.startDate" format="dd/MM/yyyy"/>
								</display:column>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.noofviews"
									value="0" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.noofclicks"
									property="maxClicks" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.status" class="grid-bg common-text">
									<s:if test="%{#attr.row.status == 1}">
										Pending
									</s:if>
									<s:elseif test="%{#attr.row.status == 2}">
										approved
									</s:elseif>
									<s:elseif test="%{#attr.row.status == 3}">
										Rejected
									</s:elseif>
									<s:elseif test="%{#attr.row.status == 4}">
										Suspended
									</s:elseif>
									<s:elseif test="%{#attr.row.status == 5}">
										Active
									</s:elseif>
									<s:elseif test="%{#attr.row.status == 6}">
										Expired
									</s:elseif>
								</display:column>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.categories"
									class="grid-bg common-text">
										<s:iterator value="#attr.row.categories" var="categories"
											status="status">
											<s:property value="%{#attr.row.categories[#status.index]}" />
											<s:if test="#status.last == false">-></s:if>
										</s:iterator>
									</display:column>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.bannerType"
									property="bannerSettings.formatName" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.campaignType"
									class="grid-bg common-text">
										<s:if test="%{#attr.row.clicks != null}">
											<s:text name="manageAccount.click" />
										</s:if>
										<s:elseif test="%{#attr.row.views != null}">
											<s:text name="manageAccount.View" />
										</s:elseif>
										<s:elseif test="%{#attr.row.days != null}">
											<s:text name="manageAccount.Day" />
										</s:elseif>
									</display:column>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.purchased"
									value="1000" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.spent"
									value="800" class="grid-bg common-text"/>
								<display:column headerClass="grid-header-bg grid-header-text" titleKey="manageAccount.action" class="grid-bg common-text">
									<table>
										<tr>
											<td id="mddm" valign="top" rowspan="2"
												class="common-text">
												<a class="navi-link" href="#"
													onmouseover="mopen('<s:property value="#attr.row.id" />', this, 'navi-link', 'right', <s:property value="#attr.row.id" />)"
													onmouseout="mclosetime()"><s:text name="manageAccount.select" /></a>
												<div style="visibility: hidden;" id="<s:property value="#attr.row.id" />"
													onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
													<a href="showAddNewCampaign.htm?id=<s:property value="#attr.row.id" />"><s:text name="manageAccount.edit" /> </a>
													<s:if test="%{#attr.row.status == 5}">
														<a
															href="modifyBannerCampaign.htm?id=<s:property value="#attr.row.id" />&param=suspend&pageSize=${pageSize}"><s:text name="manageAccount.suspend" /> </a>
													</s:if>
													<s:if test="%{#attr.row.status == 6}">
														<a
															href="javascript: wantToDeleteWithURL('modifyBannerCampaign.htm?id=<s:property value="#attr.row.id" />&param=delete&pageSize=${pageSize}','Do you want to delete this Campaign?')"><s:text name="manageAccount.delete" /> </a>
															<a
															href="modifyBannerCampaign.htm?id=<s:property value="#attr.row.id" />&param=resubmit">Resubmit</a>
													</s:if>
													<a href="#"><s:text name="manageAccount.status"></s:text> </a>
												</div>
											</td>
										</tr>
									</table>
								</display:column>
								<display:column>
									<tr>
										<td colspan="12" Class="grid-bg common-text" >
											<a href="" target="_blank"> <img
												src="servlet/ImageServlet?dto=BannerCampaigns&id=<s:property value="#attr.row.id"/>"
												alt="alttext" border="0"
												style="margin: 5px 0px 0px 5px"> </a>
										</td>
									</tr>
								</display:column>
							</display:table>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
	<tr>
		<td>
			<table>
				<tr>
					<td class="common-text">
						<s:text name="manageAccount.campaignsperpage" />
					</td>
					<td>
						<s:select cssClass="textfiled-border" onchange="document.manageAccounts.submit();"
							name="pageSize" list="#{'1':'10','2':'20','3':'50','4':'100'}" theme="simple"></s:select>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</s:form>